<template>

    <el-container>
        <el-header style="display: flex;justify-content: space-between;align-items: center;">
            <h3>用户管理</h3>
            <div class="time">2024-02-01</div>
        </el-header>
        <el-main>
            
                <div class="peoplebox">

                    <div style="margin-top: 20px;">
                        <el-input
      v-model="input_search"
      style="max-width: 600px"
      placeholder="Please input"
      class="input-with-select"
    >
  
      <template #prepend>
        <el-select v-model="input_search" placeholder="选择" style="width: 115px">
          <el-option label="用户名" value="1" />
          <el-option label="邮箱" value="2" />
          
        </el-select>
      </template>
      <template #append>
        <el-button :icon="Search" />
      </template>
    </el-input>
                    </div>
                    <div style="margin-top: 20px;">
        <el-button type="primary" :icon="Plus">新增</el-button>
    <el-button type="primary" :icon="DeleteFilled">
      批量删除
    </el-button>
    </div>
    
                    <el-table :data="filterTableData" style="width: 100%">
    <el-table-column label="Date" prop="date" />
    <el-table-column label="用户名" prop="name" />
    <el-table-column align="right">
      <template #header>
        <el-input v-model="search" size="small" placeholder="Type to search" />
      </template>
      <template #default="scope">
        <el-button size="small" @click="handleEdit(scope.$index, scope.row)"
          >Edit</el-button
        >
        <el-button
          size="small"
          type="danger"
          @click="handleDelete(scope.$index, scope.row)"
          >Delete</el-button
        >
      </template>
    </el-table-column>
  </el-table>
                </div>
           
         
          
           

        </el-main>
    </el-container>



</template>

<script lang="ts" setup>
import { computed, ref } from 'vue'
import { Search ,Plus,DeleteFilled } from '@element-plus/icons-vue'
const input_search=ref('')


interface User {
  date: string
  name: string
  address: string
}

const search = ref('')
const filterTableData = computed(() =>
  tableData.filter(
    (data) =>
      !search.value ||
      data.name.toLowerCase().includes(search.value.toLowerCase())
  )
)
const handleEdit = (index: number, row: User) => {
  console.log(index, row)
}
const handleDelete = (index: number, row: User) => {
  console.log(index, row)
}

const tableData: User[] = [
  {
    date: '2016-05-03',
    name: 'Tom',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-02',
    name: 'John',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-04',
    name: 'Morgan',
    address: 'No. 189, Grove St, Los Angeles',
  },
  {
    date: '2016-05-01',
    name: 'Jessy',
    address: 'No. 189, Grove St, Los Angeles',
  },
]
</script>

<style scoped lang='scss'>
.peoplebox {
    display: flex;
    flex-direction: column;
    width: 95%;
    height: 100vh;
    background-color: rgba(227, 227, 202, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 0.8px solid rgba(255, 255, 255, 0.18);
    box-shadow: rgba(142, 142, 142, 0.19) 0px 6px 15px 0px;
    -webkit-box-shadow: rgba(142, 142, 142, 0.19) 0px 6px 15px 0px;
    border-radius: 13px;
    -webkit-border-radius: 13px;
    padding: 20px;
}




::v-deep .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell {
  background-color: #94b3dc;
}



::v-deep .el-table {
    margin-top: 20px;
  border: 1px ;
  border-radius: 10px;
//   background-color: ;
--el-table-header-bg-color: rgba(227, 227, 202, 0.4);

  .el-table__body {
    color: rgb(21, 19, 19);
    border-spacing: 0px 0px;

    // border-collapse: collapse;
    tr {
      height: 55px;
      background-color: rgba(227, 227, 202, 0.4);
      border: 2px solid black;
     th{
        height: 60px;
        background-color: rgba(227, 227, 202, 0.4);
     }
      td {
        border-bottom: 1px solid rgb(135, 128, 128);
        //    background-color: rgba(227, 227, 202, 0.4);
      }
    }
  }

}

</style>